<template>
	<view class="historyReport">
		<web-view :webview-styles="webviewStyles" :src="reUrl"></web-view>
	</view>
</template>

<script>
	import config from '@/config'
	import {
		getOutpatientElectBill
	} from "@/api/pay/index.js"
	export default {
		data() {
			return {
				reUrl: '',
				webviewStyles: {
					progress: {
						color: "#FF3333"
					}
				},
			}
		},
		components: {

		},
		onLoad(options) {
			this.getUrl(options.inpNo, options.orderNo)
		},
		mounted() {
        
		},
		methods: {
			getUrl(inpNo, orderNo) {
				getOutpatientElectBill({
					inpNo: inpNo || '',
					orderNo: orderNo || '',
					inOrOutp: 'mz'
				}).then(res => {
					console.log(res.msg, '------------------电子发票------------------')
					if (res.msg && res.msg.includes('|http')) {
						let indexs = res.msg.indexOf('|http')
						let urls = res.msg.substring(indexs + 1, res.msg.length - 1)
						window.location.href = urls
					} else {
						this.$msg("未获取到电子发票链接");
					}
				})
			},
			init() {
				// this.reUrl = urls
				// this.reUrl = '/static/hybrid/html/web/viewer.html?file=./compressed.tracemonkey-pldi-09.pdf'	
			}
		}

	}
</script>
<style lang="scss">
	.historyReport {
		width: 100%;
	}
</style>